package uy.edu.um.ltic.server.business;

import java.sql.Timestamp;
import java.util.ArrayList;

import uy.edu.um.ltic.exception.DataBaseException;
import uy.edu.um.ltic.server.persistence.ConferenceDAOFactory;

public class ConferenceMgr implements ConferenceMgt{
	
	private static ConferenceMgr instance;
	
	private ConferenceMgr() {
	}
	
	public static ConferenceMgr getInstance(){
		if (instance == null){
			instance = new ConferenceMgr();
		}
		return instance;
	}
	
	@Override
	public void addConference(Conference conference) throws DataBaseException {
		ConferenceDAOFactory.getInstance().getConferenceDAOMgt().addConference(conference);
			
	}

	@Override
	public void deleteConference(Conference c) throws DataBaseException {
		ConferenceDAOFactory.getInstance().getConferenceDAOMgt().deleteConference(c);
	}

	@Override
	public ArrayList<Conference> getConferencesImIn(Employee oEmployee) throws DataBaseException {
		ArrayList<Conference> oListConf = ConferenceDAOFactory.getInstance().getConferenceDAOMgt().getConferencesImIn(oEmployee);
		return oListConf;
	}

	@Override
	public ArrayList<Conference> getConferencesImTheOrganizer(Employee oEmployee) throws DataBaseException {
		ArrayList<Conference> oListConf = ConferenceDAOFactory.getInstance().getConferenceDAOMgt().getConferencesImTheOrganizer(oEmployee);
		return oListConf;
	}

	@Override
	public ArrayList<Employee> getAllParticipants(int idConference) throws DataBaseException {
		ArrayList<Employee> oListEmpl = ConferenceDAOFactory.getInstance().getConferenceDAOMgt().getAllParticipants(idConference);
		return oListEmpl;
	}

	@Override
	public String getConferenceName(int idConf) throws DataBaseException {
		return ConferenceDAOFactory.getInstance().getConferenceDAOMgt().getConferenceName(idConf);
	}

	@Override
	public Timestamp getConfDate(int idConf) throws DataBaseException {
		return ConferenceDAOFactory.getInstance().getConferenceDAOMgt().getConfDate(idConf);
	}

}
